﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;//引入正则表达式命名空间

namespace msBsc.WebUi.Custom
{
    public partial class Index2 : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //SetContrlValue("spnTeest", GetFormParam("para"));
            ////Label1.Text = Page.RouteData.Values["para"] as string;   // “para”就是所设置的路由地址的参数
            ddddddd();

            //msBsc.AppLogic.Cfg.JSCompress oJSCompress = new AppLogic.Cfg.JSCompress();
            //oJSCompress.doCompress(msBsc.AppLogic.Cfg.SystemFileDir.FileDir.GetMapPathByVpath("jqPlugin/js/jQueryCmd.js"), msBsc.AppLogic.Cfg.SystemFileDir.FileDir.GetMapPathByVpath("jqPlugin/js/jQueryCmd2.js"));
        }


        private void ddddddd()
        {
            string[] straaaa = new string[]{
                "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\seed\\1.4.5\\seed_old.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\seed-g\\1.0.33\\seed.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\btscfg-g\\1.1.0\\index.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\bucket\\1.2.1\\index.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\globalmodule\\1.3.27\\global-module.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\global\\1.2.35\\global.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\global\\1.2.35\\responsive.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\tm\\fp\\3.0.13\\seed.js"
               , "E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\tm\\fp\\3.0.13\\init.js"
            };

            for (int i = 0; i < straaaa.Length; i++)
            {
                msBsc.SvRef.SRWebClient oSRWebClient = new SvRef.SRWebClient();
                //System.IO.StreamReader ooo = new System.IO.StreamReader("E:\\ProjectCode\\msBsc\\SourceCode\\CODE\\WB\\jqPlugin\\mui\\seed\\1.4.5\\seed_old.js");
                System.IO.StreamReader ooo = new System.IO.StreamReader(straaaa[i]);
                string ster33333 = ooo.ReadToEnd();



                System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex("path.{0,5}\".*?\"",
                    System.Text.RegularExpressions.RegexOptions.Compiled);
                System.Text.RegularExpressions.Match m = r.Match(ster33333);
                while (m.Success)
                {
                    if (m.Value.IndexOf("/") == -1)
                    {
                        m = m.NextMatch();
                        continue;
                    }
                    string ster2333r = m.Value.Substring(m.Value.IndexOf("\"") + 1);
                    ster2333r = ster2333r.Substring(0, ster2333r.LastIndexOf("\""));
                    string sterrrr = ster2333r;// "mui/popbox/1.0.3/index.js";
                    //string strSaveDir=sterrrr.Substring(0,sterrrr.LastIndexOf("/"));
                    string strSaveDir = "d:\\kissytem\\" + sterrrr.Replace("/", "\\");
                    if (!sterrrr.StartsWith("http"))
                    {
                        sterrrr = "http://g.tbcdn.cn/" + sterrrr;
                    }

                    oSRWebClient.DownloadFile(sterrrr, strSaveDir, false);
                    m = m.NextMatch();
                }

            }



        }

    }
}